<%-- 
    Document   : sv3_main_header
    Created on : May 5, 2014, 3:15:27 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Ship Visit Admin :.</title>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#dialog-form").dialog({
                    autoOpen: false,
                    height: 500,
                    width: 600,
                    modal: true,
                    buttons: {
                        "Save": function() {
                            if(validateBlankSub()){
                                var frm = document.forms.popupForm;
                                frm.action = frm.action + '?saveUpdateSubHeader';
                                frm.submit();
                            }
                        },
                        Cancel: function() {
//                            refreshSub();
                            $(this).dialog("close");
                        }
                    },
                    close: function() {
                    }
                });

            });
            
            function popEdit(id){
                var url = '${pageContext.request.contextPath}/shipVisit3Admin?newEditSubHeader&id=' + id;
                $.get(url, function(data){
                    $('#dialog-form').html(data);
                });
                $('#dialog-form').dialog("open");
            }
            
            function refreshSub(){
                var frm = document.forms.formList;
                frm.action = frm.action + '?refreshSubHeader';
                frm.submit();
            }
        </script>
    </head>
    <body>
        <s:messages />
        <s:errors />
        <s:form beanclass="exatrez.stripes.action.ShipVisit3AdminAction" name="formList">
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">Ship Visit Admin</span>
                    </div>
                    <div>
                        <span class="sub-title">List Additional Header for Ship Visit Form</span><br />
                        <s:button name="" value="Add New" class="btn" onclick="return popEdit('');" />
                        <display:table class="tablecloth" name="${actionBean.listSubHeader}" requestURI="/shipVisit3Admin?viewSubHeader" id="line" >
                            <display:column title="No."><center>${line_rowNum}.</center></display:column>
                            <display:column title="Add. Header Name" sortable="true" property="description" />                            
                            <display:column title="Input Type" >
                                <c:if test="${line.inputType eq 'S'}">
                                    Single Line
                                </c:if>
                                <c:if test="${line.inputType eq 'M'}">
                                    Multiple Line
                                </c:if>
                            </display:column>
                            <display:column title="Active Flag">
                                <c:if test="${line.activeFlag eq 'I'}">
                                    Inactive
                                </c:if>
                                <c:if test="${line.activeFlag eq 'A'}">
                                    Active
                                </c:if>
                            </display:column>
                            <display:column title="Sort No." property="orderFlag" />
                            <display:column title="Create By" property="infoAudit.createId.userId" />
                            <display:column title="Create Date">
                                <fmt:formatDate value="${line.infoAudit.createDate}" pattern="dd/MM/yyyy hh:mm:ss a"/>
                            </display:column>
                            <display:column title="action" >
                                <%--<center>
                                    <a href="shipVisit3Admin?killSession&sessionKill=${line.sessionId}" onclick="javascript:return confirmation('${line.userId}');">
                                        <img src="${pageContext.request.contextPath}/images/icon/not_ok.gif" alt="Kill Session" width="20" height="20"/>
                                    </a>
                                </center>--%>
                                <center>
                                    <img alt='Click for Edit' border='0' src='${pageContext.request.contextPath}/images/icon/edit.png' 
                                        onclick="popEdit('${line.refShipVisitSubId}');return false;" onmouseover="this.style.cursor = 'pointer';">
                                </center>
                            </display:column>
                        </display:table>
                    </div>
                </fieldset>
            </div>
        </s:form>
        <div id="dialog-form" title="Edit Additional Header">
        </div>
    </body>
</html>
